home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18046 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
  4. Subject: Re: fastest code
  5. Date: Thu, 18 Apr 96 16:54:59 GMT
  6. Organization: none
  7. Message-ID: <829846499snz@genesis.demon.co.uk>
  8. References: <316112A2.7D37@public.sta.net.cn> <4kjpn0INN817@keats.ugrad.cs.ubc.ca> <829352535snz@genesis.demon.co.uk> <4kof6e$te@news1.mnsinc.com> <4krbhlINNbk4@keats.ugrad.cs.ubc.ca> <3171E8D2.41C67EA6@scn.de> <4l2455$22f@nnrp1.news.primenet.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4l2455$22f@nnrp1.news.primenet.com>
  15.            rogersr@primenet.com "Randy Rogers" writes:
  16.  
  17. >Why not just look at the machine code with the debugger?
  18. >there is also an issue of whether signed arithemetic is being performed
  19. >if not  you could just shift left 1, add, or multiply with the same result
  20. >how large are the vars...doubles would require additional register usage
  21.  
  22. 2*i means exactly the same thing as i+i whether i is signed or
  23. unsigned, so the compiler can always compiler them to the same code. It
  24. could compile either using shifts or adds.
  25.  
  26. -- 
  27. -----------------------------------------
  28. Lawrence Kirby | fred@genesis.demon.co.uk
  29. Wilts, England | 70734.126@compuserve.com
  30. -----------------------------------------
  31.